﻿using CommunityToolkit.Mvvm.ComponentModel;
using WpfMvvmTemplate.WPFUI.Common;
using System.Collections.ObjectModel;
using Wpf.Ui.Controls;

namespace WpfMvvmTemplate.WPFUI.Models.Windows
{
    public partial class MainWindowModel : ObservableObject
    {
        [ObservableProperty]
        private string applicationTitle;

        [ObservableProperty]
        private ObservableCollection<object> menuItems;

        [ObservableProperty]
        private ObservableCollection<object> footerMenuItems;

        public MainWindowModel()
        {
            ApplicationTitle = "WpfMvvmTemplate.WPFUI";

            #region 初始化菜单栏

            MenuItems = new()
            {
                new NavigationViewItem()
                {
                    Content = "实时监控",
                    Icon = new SymbolIcon { Symbol = SymbolRegular.StreamInputOutput20 },
                    TargetPageType = typeof(Views.Pages.DashboardPage),
                    MenuItemsSource = new object[]
                    {
                        new NavigationViewItem("磁场", SymbolRegular.ArrowSyncCheckmark24, typeof(Views.Pages.DashboardPage)),
                        new NavigationViewItem("温度", SymbolRegular.Fire24, typeof(Views.Pages.DashboardPage)),
                        new NavigationViewItem("真空", SymbolRegular.FoodEgg24, typeof(Views.Pages.DashboardPage)),
                        new NavigationViewItem("电压", SymbolRegular.BatteryCharge24, typeof(Views.Pages.DashboardPage))
                    }
                },
                new NavigationViewItem()
                {
                    Content = "设备管理",
                    Icon = new SymbolIcon { Symbol = SymbolRegular.CalculatorMultiple24 },
                    TargetPageType = typeof(Views.Pages.DataPage),
                    MenuItemsSource = new object[]
                    {
                        new NavigationViewItem("磁场", SymbolRegular.ArrowSyncCheckmark24, typeof(Views.Pages.DashboardPage)),
                        new NavigationViewItem("温度", SymbolRegular.Fire24, typeof(Views.Pages.DashboardPage)),
                        new NavigationViewItem("真空", SymbolRegular.FoodEgg24, typeof(Views.Pages.DashboardPage)),
                        new NavigationViewItem("电压", SymbolRegular.BatteryCharge24, typeof(Views.Pages.DashboardPage))
                    }
                },
                new NavigationViewItem()
                {
                    Content = "历史记录",
                    Icon = new SymbolIcon { Symbol = SymbolRegular.History24 },
                    TargetPageType = typeof(Views.Pages.DataPage)
                },
                new NavigationViewItem()
                {
                    Content = "故障分析",
                    Icon = new SymbolIcon { Symbol = SymbolRegular.ErrorCircleSettings20 },
                    TargetPageType = typeof(Views.Pages.DataPage),

                }
            };

            FooterMenuItems = new()
            {
                new NavigationViewItem()
                {
                    Content = App.IsDesignTime ? "设置" : GlobalStaticData.LanguageDic["Settings"],
                    Icon = new SymbolIcon { Symbol = SymbolRegular.Settings24 },
                    TargetPageType = typeof(Views.Pages.SettingsPage)
                }
            };

            #endregion


        }

    }
}
